#pragma once
#include "CBase.h"
#include "SGD Wrappers\SGD_Math.h"
#include "Messaging\IListener.h"

class CTurret : public CBase, public IListener
{
private:
	tVector2D m_tFacingDir;
	tVector2D m_tVec2Ship;
	float m_fCurrentRotation;
	CBase *m_Target;
	float m_fDistanceToTarget;

	int m_nLazerShot;

	int m_iRank;
public:
	CTurret();
	~CTurret();
	void SetTarget(CBase* _target);
	void Update(float _fElapsedTime);
	void Render();
	bool CheckCollision(IBaseInterface *_pIBase);
	RECT GetCollisonRect();
	void SetSoundID( int _sound) {m_nLazerShot = _sound;}

	float GetRotation() {return m_fCurrentRotation;}

	int GetRank(){return m_iRank;}
	void SetRank(int _iRank){m_iRank = _iRank;}

	void HandleEvent(CEvent* pEvent);
};